import zerorpc


class caculate(object):
    def hello(self, name):
        return 'hello, {}'.format(name)

    def add(self, x, y):
        return x + y

    def multiply(self, x, y):
        return x * y

    def subtract(self, x, y):
        return abs(x - y)

    def divide(self, x, y):
        return x / y
        
    def eval(self, code):
        return eval(code)

s = zerorpc.Server(caculate())

s.bind("tcp://0.0.0.0:4242")
s.run()